3.12 \(\int \frac{d+e x+f x^2+g x^3}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=57 \[ -\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} (e+g) \log \left (1-x^2\right )+\frac{1}{6} (e+4 g) \log \left (4-x^2\right ) \]

[Out]

-((d + 4*f)*ArcTanh[x/2])/6 + ((d + f)*ArcTanh[x])/3 - ((e + g)*Log[1 - x^2])/6
+ ((e + 4*g)*Log[4 - x^2])/6

_______________________________________________________________________________________

Rubi [A]  time = 0.175102, antiderivative size = 57, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214 \[ -\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} (e+g) \log \left (1-x^2\right )+\frac{1}{6} (e+4 g) \log \left (4-x^2\right ) \]

Antiderivative was successfully verified.

[In]  Int[(d + e*x + f*x^2 + g*x^3)/(4 - 5*x^2 + x^4),x]

[Out]

-((d + 4*f)*ArcTanh[x/2])/6 + ((d + f)*ArcTanh[x])/3 - ((e + g)*Log[1 - x^2])/6
+ ((e + 4*g)*Log[4 - x^2])/6

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 33.6666, size = 51, normalized size = 0.89 \[ - \left (\frac{d}{6} + \frac{2 f}{3}\right ) \operatorname{atanh}{\left (\frac{x}{2} \right )} + \left (\frac{d}{3} + \frac{f}{3}\right ) \operatorname{atanh}{\left (x \right )} - \left (\frac{e}{6} + \frac{g}{6}\right ) \log{\left (- x^{2} + 1 \right )} + \left (\frac{e}{6} + \frac{2 g}{3}\right ) \log{\left (- x^{2} + 4 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

-(d/6 + 2*f/3)*atanh(x/2) + (d/3 + f/3)*atanh(x) - (e/6 + g/6)*log(-x**2 + 1) +
(e/6 + 2*g/3)*log(-x**2 + 4)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0589006, size = 68, normalized size = 1.19 \[ \frac{1}{12} (-2 \log (1-x) (d+e+f+g)+\log (2-x) (d+2 e+4 f+8 g)+2 \log (x+1) (d-e+f-g)-\log (x+2) (d-2 e+4 f-8 g)) \]

Antiderivative was successfully verified.

[In]  Integrate[(d + e*x + f*x^2 + g*x^3)/(4 - 5*x^2 + x^4),x]

[Out]

(-2*(d + e + f + g)*Log[1 - x] + (d + 2*e + 4*f + 8*g)*Log[2 - x] + 2*(d - e + f
 - g)*Log[1 + x] - (d - 2*e + 4*f - 8*g)*Log[2 + x])/12

_______________________________________________________________________________________

Maple [B]  time = 0.013, size = 114, normalized size = 2. \[ -{\frac{\ln \left ( 2+x \right ) d}{12}}+{\frac{\ln \left ( 2+x \right ) e}{6}}-{\frac{\ln \left ( 2+x \right ) f}{3}}+{\frac{2\,\ln \left ( 2+x \right ) g}{3}}-{\frac{\ln \left ( -1+x \right ) d}{6}}-{\frac{\ln \left ( -1+x \right ) e}{6}}-{\frac{\ln \left ( -1+x \right ) f}{6}}-{\frac{\ln \left ( -1+x \right ) g}{6}}+{\frac{\ln \left ( 1+x \right ) d}{6}}-{\frac{\ln \left ( 1+x \right ) e}{6}}+{\frac{\ln \left ( 1+x \right ) f}{6}}-{\frac{\ln \left ( 1+x \right ) g}{6}}+{\frac{\ln \left ( x-2 \right ) d}{12}}+{\frac{\ln \left ( x-2 \right ) e}{6}}+{\frac{\ln \left ( x-2 \right ) f}{3}}+{\frac{2\,\ln \left ( x-2 \right ) g}{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

-1/12*ln(2+x)*d+1/6*ln(2+x)*e-1/3*ln(2+x)*f+2/3*ln(2+x)*g-1/6*ln(-1+x)*d-1/6*ln(
-1+x)*e-1/6*ln(-1+x)*f-1/6*ln(-1+x)*g+1/6*ln(1+x)*d-1/6*ln(1+x)*e+1/6*ln(1+x)*f-
1/6*ln(1+x)*g+1/12*ln(x-2)*d+1/6*ln(x-2)*e+1/3*ln(x-2)*f+2/3*ln(x-2)*g

_______________________________________________________________________________________

Maxima [A]  time = 0.706383, size = 82, normalized size = 1.44 \[ -\frac{1}{12} \,{\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f - g\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f + g\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f + 8 \, g\right )} \log \left (x - 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^3 + f*x^2 + e*x + d)/(x^4 - 5*x^2 + 4),x, algorithm="maxima")

[Out]

-1/12*(d - 2*e + 4*f - 8*g)*log(x + 2) + 1/6*(d - e + f - g)*log(x + 1) - 1/6*(d
 + e + f + g)*log(x - 1) + 1/12*(d + 2*e + 4*f + 8*g)*log(x - 2)

_______________________________________________________________________________________

Fricas [A]  time = 0.48402, size = 82, normalized size = 1.44 \[ -\frac{1}{12} \,{\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f - g\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f + g\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f + 8 \, g\right )} \log \left (x - 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^3 + f*x^2 + e*x + d)/(x^4 - 5*x^2 + 4),x, algorithm="fricas")

[Out]

-1/12*(d - 2*e + 4*f - 8*g)*log(x + 2) + 1/6*(d - e + f - g)*log(x + 1) - 1/6*(d
 + e + f + g)*log(x - 1) + 1/12*(d + 2*e + 4*f + 8*g)*log(x - 2)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.291984, size = 93, normalized size = 1.63 \[ -\frac{1}{12} \,{\left (d + 4 \, f - 8 \, g - 2 \, e\right )}{\rm ln}\left ({\left | x + 2 \right |}\right ) + \frac{1}{6} \,{\left (d + f - g - e\right )}{\rm ln}\left ({\left | x + 1 \right |}\right ) - \frac{1}{6} \,{\left (d + f + g + e\right )}{\rm ln}\left ({\left | x - 1 \right |}\right ) + \frac{1}{12} \,{\left (d + 4 \, f + 8 \, g + 2 \, e\right )}{\rm ln}\left ({\left | x - 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^3 + f*x^2 + e*x + d)/(x^4 - 5*x^2 + 4),x, algorithm="giac")

[Out]

-1/12*(d + 4*f - 8*g - 2*e)*ln(abs(x + 2)) + 1/6*(d + f - g - e)*ln(abs(x + 1))
- 1/6*(d + f + g + e)*ln(abs(x - 1)) + 1/12*(d + 4*f + 8*g + 2*e)*ln(abs(x - 2))